{{include file="header.html"}}
{{include file="menu.html"}}
		<!-- 右边侧边栏 -->
		<div class="right">
			<!-- 个人信息部分 -->
			<div class="item">
				<form action="index.php?app=personal" name="myform" method="post" class="ajaxSubmit" onsubmit="return false">
				<div class="btn">
					<span class="span_t">个人信息表</span>
					<a href="index.php?app=Personal&act=print_info" class="print">打印</a>
					<button class="change">修改</button>
					<button class="sure" onclick="checked();">确认</button>
					<div class="clear"></div>
				</div>
				<table border="1">
					<tr>
						<td class="one">姓名<span class="need">*</span></td>
						<td class="two"><input type="text" value="{{$result.username}}" name="username"></td>
						<td class="one">班级<span class="need">*</span></td>
						<td class="two"><input type="text" value="{{$result.params.class}}" name="params[class]"></td>
						<td class="one">性别<span class="need">*</span></td>
						<td class="two">
							<label for="mans"><input type="radio" {{if $result.sex == '0'}}checked="checked"{{/if}} name="sex" id="mans" value="0">男</label>
							<label for="womans"><input type="radio" {{if $result.sex == '1'}}checked="checked"{{/if}} name="sex" id="womans" value="1">女</label>
						</td>
					</tr>
					<tr>
						<td class="one">出生日期<span class="need">*</span></td>
						<td class="two"><input type="text" id="datepicker" name="params[birthdate]" value="{{$result.params.birthdate}}"></td>
						<td class="one">身份证<span class="need">*</span></td>
						<td class="two"><input type="text" name="params[indentify]" value="{{$result.params.indentify}}"></td>
						<td class="one">民族<span class="need">*</span></td>
						<td class="two"><input type="text" name="params[nation]" value="{{$result.params.nation}}"></td>
					</tr>
					<tr>
						<td class="one">学号<span class="need">*</span></td>
						<td class="two"><input type="text" name="params[number]" value="{{$result.params.number}}"></td>
						<td class="one">手机<span class="need">*</span></td>
						<td class="two"><input type="text" name="mobile" value="{{$result.mobile}}"></td>
						<td class="one">邮箱<span class="need">*</span></td>
						<td class="two"><input type="text" name="email" value="{{$result.email}}"></td>
					</tr>
					<tr>
						<td class="one">QQ</td>
						<td class="two"><input type="text" name="params[qq]" value="{{$result.params.qq}}"></td>
						<td class="one">家庭住址</td>
						<td class="two" colspan="3"><input type="text" name="params[address]" value="{{$result.params.address}}"></td> 
					</tr>
					<tr>
						<td class="one">爱好特长</td>
						<td class="two" colspan="5"><input type="text" name="params[hobby]" value="{{$result.params.hobby}}"></td>
					</tr>
				</table>
				</form>
			</div>
		</div>
	</div>
	<!-- 回到顶部 -->
	<div class="toTop"><span>↑</span>顶部</div>
	<script type="text/javascript">
	$(function(){
		$(".right input,.right textarea").attr("disabled","false").css("border","none");

		// 点击修改按钮时改变样式
		$(".change").click(function(){
			$("input,textarea").removeAttr("disabled").css("border","1px solid #D8D8D8");
			$(this).hide();
			$(".sure").show()
		})

		// 日期调用
		laydate.render({
		  elem: '#datepicker' //指定元素
		});

		$("input").keydown(function(e){
			var curkey = e.which; 
			if(curkey == 13){ 
				checked();
			}
		}); 	
	})

	//信息验证
	function checked(){
	    var params = $("form").serialize();
	    $.post('{{"index.php?app=Personal&act=info"|URL}}',params,function(result){
	        if(result.statusCode=='200'){
	        	ui.success(result.message);
	   			// 点击确认按钮时改变样式
				$(".right input,.right textarea").attr("disabled","false").css("border","none");
				$(".sure").hide();
				$(".change").show()
	        }else if(result.statusCode=='300'){
	        	ui.error(result.message)
	        }
	    },'json');
	};
	</script>
{{include file="footer.html"}}